<?php
session_start();

if(isset($_SESSION['s_username'])){
		
	require 'phpScripts/connection/connection.php';
	
	$query = "SELECT * FROM categorias";
	$result = mysql_query($query) or die("se produjo un error al obtener las categorias");

	echo '<select name="categoriaId" required>';
	echo '<option value="">Seleccione una categoria</option>';		
	while ($row = mysql_fetch_array($result)){
		echo '<option value="'.$row['categoriaId'].'">'.$row['categoriaDescripcion'].'</option>';
	}
	echo '</select>';
	
	mysql_close();
	
}else{
	header ("location: ../../index.php");
}
?>